//
//  SSDKFWPayInfo.m
//  SuperSDK
//
//  Created by wyht－ios－dev on 15/10/7.
//  Copyright © 2015年 WYHT. All rights reserved.
//

#import "SSDKFWPayInfo.h"
#import "SSDKDataKeys.h"

@implementation SSDKFWPayInfo

- (instancetype) initWithPayInfo:(SSDKBaseResData *) resData {
    self = [super init];
    
    if ( self) {
        self.status = resData.status;
        self.data = resData.data;
        self.common = resData.common;
        self.extra = resData.extra;
    }
    
    return self;
}

- (instancetype) setRoleId:(NSString *)roleId {
    [self.data setValue:roleId forKey:ROLE_ID];
    return self;
}

- (NSString *) roleId {
    return [self dataWithKey:ROLE_ID];
}

- (instancetype) setRoleName:(NSString *)roleName {
    return [self setDataValue:roleName forKey:ROLE_NAME];
}

- (NSString *) roleName {
    return [self dataWithKey:ROLE_NAME];
}

- (instancetype) setRoleGrade:(NSString *)roleGrade {
    return [self setDataValue:roleGrade forKey:ROLE_GRADE];
}

- (NSString *) roleGrade {
    return [self dataWithKey:ROLE_GRADE];
}

- (instancetype) setRoleBalance:(NSString *)roleBalance {
    return [self setDataValue:roleBalance forKey:ROLE_BALANCE];
}

- (NSString *) roleBalance {
    return [self dataWithKey:ROLE_BALANCE];
}

- (instancetype) setOrderId:(NSString *)orderId {
    return [self setDataValue:orderId forKey:ORDER_ID];
}

- (NSString *) orderId {
    return [self dataWithKey:ORDER_ID];
}

- (instancetype) setOrderAmount:(float)orderAmount {
    NSString *amount = [NSString stringWithFormat:@"%f", orderAmount];
    return [self setDataValue:amount forKey:ORDER_AMOUNT];
}

- (float) orderAmount {
    return [[self dataWithKey:ORDER_AMOUNT] floatValue];
}

- (instancetype) setPayStatus:(NSString *)payStatus {
    return [self setDataValue:payStatus forKey:PAY_STATUS];
}

- (NSString *) payStatus {
    return [self dataWithKey:PAY_STATUS];
}

- (instancetype) setPayTime:(long)payTime {
    NSString *time = [NSString stringWithFormat:@"%ld", payTime];
    return [self setDataValue:time forKey:PAY_TIME];
}

- (long) payTime {
    return [[self dataWithKey:PAY_TIME] longLongValue];
}

- (instancetype) setPayType:(NSString *)payType {
    return [self setDataValue:payType forKey:PAY_TYPE];
}

- (NSString *) payType {
    return [self dataWithKey:PAY_TYPE];
}

- (instancetype) setSuperSDKUid:(NSString *)sUid {
    return [self setDataValue:sUid forKey:SUPERSDK_UID];
}

- (NSString *) superSDKUid {
    return [self dataWithKey:SUPERSDK_UID];
}

- (instancetype) setGameUid:(NSString *)gameUid {
    return [self setDataValue:gameUid forKey:GAME_UID];
}

- (NSString *) gameUid {
    return [self dataWithKey:GAME_UID];
}

- (instancetype) setServerId:(NSString *)serverId {
    return [self setDataValue:serverId forKey: SERVER_ID];
}

- (NSString *) serverId {
    return [self dataWithKey:SERVER_ID];
}

- (instancetype) setProductId:(NSString *)productId {
    return [self setDataValue:productId forKey:PRODUCT_ID];
}

- (NSString *) productId {
    return [self dataWithKey:PRODUCT_ID];
}

- (instancetype) setProductCount:(NSString *)productCount {
    return [self setDataValue:productCount forKey:PRODUCT_COUNT];
}

- (NSString *) productCount {
    return [self dataWithKey:PRODUCT_COUNT];
}

- (instancetype) setProductName:(NSString *)productName {
    return [self setDataValue:productName forKey:PRODUCT_NAME];
}

- (NSString *) productName {
    return [self dataWithKey:PRODUCT_NAME];
}

- (instancetype) setAppData:(NSString *)appData {
    return [self setDataValue:appData forKey:APP_DATA];
}

- (NSString *) appData {
    return [self dataWithKey:APP_DATA];
}

@end
